#include <vector>

class Solution {
public:
    std::vector<int> corpFlightBookings(std::vector<std::vector<int>>& bookings, int n) {
        int len1 = bookings.size();
        std::vector<int> ans;   std::vector<int> ans2;
        ans.resize(n + 2);
        ans2.resize(n );
        for (int i = 0; i < len1; i++)
        {
            ans[bookings[i][0]]  += bookings[i][2];
            ans[bookings[i][1]+1] -= bookings[i][2];
        }
        int sum =0;
        for (int i = 1; i <= n;i++)
        {
        
            sum+=ans[i];
            ans2[i-1]+=sum;
        }
        
        return ans2;
    }
};